This repository has been archived by the owner on Feb 8, 2024. It is now read-only.
Update dependency scipy to v1.10.0 - autoclosed #573
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
==1.1.0
->==1.10.0
By merging this PR, the below issues will be automatically resolved and closed:
Release Notes
scipy/scipy
v1.10.0
: SciPy 1.10.0Compare Source
SciPy 1.10.0 Release Notes
SciPy
1.10.0
is the culmination of6
months of hard work. It containsmany new features, numerous bug-fixes, improved test coverage and better
documentation. There have been a number of deprecations and API changes
in this release, which are documented below. All users are encouraged to
upgrade to this release, as there are a large number of bug-fixes and
optimizations. Before upgrading, we recommend that users check that
their own code does not use deprecated SciPy functionality (to do so,
run your code with
python -Wd
and check forDeprecationWarning
s).Our development attention will now shift to bug-fix releases on the
1.10.x branch, and on adding new features on the main branch.
This release requires Python
3.8+
and NumPy1.19.5
or greater.For running on PyPy, PyPy3
6.0+
is required.Highlights of this release
scipy.datasets
) has been added, and isnow preferred over usage of
scipy.misc
for dataset retrieval.scipy.interpolate.make_smoothing_spline
function was added. Thisfunction constructs a smoothing cubic spline from noisy data, using the
generalized cross-validation (GCV) criterion to find the tradeoff between
smoothness and proximity to data points.
scipy.stats
has three new distributions, two new hypothesis tests, threenew sample statistics, a class for greater control over calculations
involving covariance matrices, and many other enhancements.
New features
scipy.datasets
introductionA new dedicated
datasets
submodule has been added. The submodulesis meant for datasets that are relevant to other SciPy submodules ands
content (tutorials, examples, tests), as well as contain a curated
set of datasets that are of wider interest. As of this release, all
the datasets from
scipy.misc
have been added toscipy.datasets
(and deprecated in
scipy.misc
).The submodule is based on Pooch
(a new optional dependency for SciPy), a Python package to simplify fetching
data files. This move will, in a subsequent release, facilitate SciPy
to trim down the sdist/wheel sizes, by decoupling the data files and
moving them out of the SciPy repository, hosting them externally and
downloading them when requested. After downloading the datasets once,
the files are cached to avoid network dependence and repeated usage.
Added datasets from
scipy.misc
:scipy.datasets.face
,scipy.datasets.ascent
,scipy.datasets.electrocardiogram
Added download and caching functionality:
scipy.datasets.download_all
: a function to download all thescipy.datasets
associated files at once.
scipy.datasets.clear_cache
: a simple utility function to clear cached datasetfiles from the file system.
scipy/datasets/_download_all.py
can be run as a standalone script forpackaging purposes to avoid any external dependency at build or test time.
This can be used by SciPy packagers (e.g., for Linux distros) which may
have to adhere to rules that forbid downloading sources from external
repositories at package build time.
scipy.integrate
improvementscomplex_func
toscipy.integrate.quad
, which can be setTrue
to integrate a complex integrand.scipy.interpolate
improvementsscipy.interpolate.interpn
now supports tensor-product interpolation methods(
slinear
,cubic
,quintic
andpchip
)slinear
,cubic
,quintic
andpchip
) inscipy.interpolate.interpn
andscipy.interpolate.RegularGridInterpolator
now allow values with trailingdimensions.
scipy.interpolate.RegularGridInterpolator
has a new fast path formethod="linear"
with 2D data, andRegularGridInterpolator
is noweasier to subclass
scipy.interpolate.interp1d
now can take a single value for non-splinemethods.
extrapolate
argument is available toscipy.interpolate.BSpline.design_matrix
,allowing extrapolation based on the first and last intervals.
scipy.interpolate.make_smoothing_spline
has been added. It is animplementation of the generalized cross-validation spline smoothing
algorithm. The
lam=None
(default) mode of this function is a clean-roomreimplementation of the classic
gcvspl.f
Fortran algorithm forconstructing GCV splines.
method="pchip"
mode was aded toscipy.interpolate.RegularGridInterpolator
. This mode constructs aninterpolator using tensor products of C1-continuous monotone splines
(essentially, a
scipy.interpolate.PchipInterpolator
instance perdimension).
scipy.sparse.linalg
improvementsThe spectral 2-norm is now available in
scipy.sparse.linalg.norm
.The performance of
scipy.sparse.linalg.norm
for the default case (Frobeniusnorm) has been improved.
LAPACK wrappers were added for
trexc
andtrsen
.The
scipy.sparse.linalg.lobpcg
algorithm was rewritten, yieldingthe following improvements:
accuracy for edge cases,
giving more accurate and orthonormal eigenvectors,
and drop the history of subsequent iterations,
LinearOperator
format input and thus allowa simple function handle of a callable object as an input,
than letting the algorithm fail.
scipy.linalg
improvementsscipy.linalg.lu_factor
now accepts rectangular arrays instead of being restrictedto square arrays.
scipy.ndimage
improvementsscipy.ndimage.value_indices
function provides a time-efficient method tosearch for the locations of individual values with an array of image data.
radius
argument is supported byscipy.ndimage.gaussian_filter1d
andscipy.ndimage.gaussian_filter
for adjusting the kernel size of the filter.scipy.optimize
improvementsscipy.optimize.brute
now coerces non-iterable/single-valueargs
into atuple.
scipy.optimize.least_squares
andscipy.optimize.curve_fit
now acceptscipy.optimize.Bounds
for bounds constraints.scipy.optimize.milp
.scipy.optimize.OptimizeResult
objects.parallel
,threads
,mip_rel_gap
) can nowbe passed to
scipy.optimize.linprog
withmethod='highs'
.scipy.signal
improvementsscipy.signal.windows.lanczos
was added to compute aLanczos window, also known as a sinc window.
scipy.sparse.csgraph
improvementsscipy.sparse.csgraph.dijkstra
has been improved, andstar graphs in particular see a marked performance improvement
scipy.special
improvementsscipy.special.powm1
, a ufunc with signaturepowm1(x, y)
, computesx**y - 1
. The function avoids the loss ofprecision that can result when
y
is close to 0 or whenx
is close to1.
scipy.special.erfinv
is now more accurate as it leverages the Boost equivalent underthe hood.
scipy.stats
improvementsAdded
scipy.stats.goodness_of_fit
, a generalized goodness-of-fit test foruse with any univariate distribution, any combination of known and unknown
parameters, and several choices of test statistic (Kolmogorov-Smirnov,
Cramer-von Mises, and Anderson-Darling).
Improved
scipy.stats.bootstrap
: Default method'BCa'
now supportsmulti-sample statistics. Also, the bootstrap distribution is returned in the
result object, and the result object can be passed into the function as
parameter
bootstrap_result
to add additional resamples or change theconfidence interval level and type.
Added maximum spacing estimation to
scipy.stats.fit
.Added the Poisson means test ("E-test") as
scipy.stats.poisson_means_test
.Added new sample statistics.
scipy.stats.contingency.odds_ratio
to compute both the conditionaland unconditional odds ratios and corresponding confidence intervals for
2x2 contingency tables.
scipy.stats.directional_stats
to compute sample statistics ofn-dimensional directional data.
scipy.stats.expectile
, which generalizes the expected value in thesame way as quantiles are a generalization of the median.
Added new statistical distributions.
scipy.stats.uniform_direction
, a multivariate distribution tosample uniformly from the surface of a hypersphere.
scipy.stats.random_table
, a multivariate distribution to sampleuniformly from m x n contingency tables with provided marginals.
scipy.stats.truncpareto
, the truncated Pareto distribution.Improved the
fit
method of several distributions.scipy.stats.skewnorm
andscipy.stats.weibull_min
now use an analyticalsolution when
method='mm'
, which also serves a starting guess toimprove the performance of
method='mle'
.scipy.stats.gumbel_r
andscipy.stats.gumbel_l
: analytical maximumlikelihood estimates have been extended to the cases in which location or
scale are fixed by the user.
scipy.stats.powerlaw
.Improved random variate sampling of several distributions.
scipy.stats.matrix_normal
,scipy.stats.ortho_group
,scipy.stats.special_ortho_group
, andscipy.stats.unitary_group
is faster.rvs
method ofscipy.stats.vonmises
now wraps to the interval[-np.pi, np.pi]
.scipy.stats.loggamma
rvs
method for smallvalues of the shape parameter.
Improved the speed and/or accuracy of functions of several statistical
distributions.
scipy.stats.Covariance
for better speed, accuracy, and user controlin multivariate normal calculations.
scipy.stats.skewnorm
methodscdf
,sf
,ppf
, andisf
methods now use the implementations from Boost, improving speed while
maintaining accuracy. The calculation of higher-order moments is also
faster and more accurate.
scipy.stats.invgauss
methodsppf
andisf
methods now use theimplementations from Boost, improving speed and accuracy.
scipy.stats.invweibull
methodssf
andisf
are more accurate forsmall probability masses.
scipy.stats.nct
andscipy.stats.ncx2
now rely on the implementationsfrom Boost, improving speed and accuracy.
logpdf
method ofscipy.stats.vonmises
for reliabilityin extreme tails.
isf
method ofscipy.stats.levy
for speed andaccuracy.
scipy.stats.studentized_range
for largedf
by adding an infinite degree-of-freedom approximation.
lower_limit
toscipy.stats.multivariate_normal
,allowing the user to change the integration limit from -inf to a desired
value.
entropy
ofscipy.stats.vonmises
for largeconcentration values.
Enhanced
scipy.stats.gaussian_kde
.scipy.stats.gaussian_kde.marginal
, which returns the desiredmarginal distribution of the original kernel density estimate distribution.
cdf
method ofscipy.stats.gaussian_kde
now accepts alower_limit
parameter for integrating the PDF over a rectangular region.scipy.stats.gaussian_kde.logpdf
to Cython,improving speed.
pdf
method ofscipy.stats.gaussian_kde
for improved multithreading performance.and accuracy.
Enhanced the result objects returned by many
scipy.stats
functionsconfidence_interval
method to the result object returned byscipy.stats.ttest_1samp
andscipy.stats.ttest_rel
.scipy.stats
functionscombine_pvalues
,fisher_exact
,chi2_contingency
,median_test
andmood
now returnbunch objects rather than plain tuples, allowing attributes to be
accessed by name.
multiscale_graphcorr
,anderson_ksamp
,binomtest
,crosstab
,pointbiserialr
,spearmanr
,kendalltau
, andweightedtau
have been renamed tostatistic
andpvalue
for consistency throughoutscipy.stats
.Old attribute names are still allowed for backward compatibility.
scipy.stats.anderson
now returns the parameters of the fitteddistribution in a
scipy.stats._result_classes.FitResult
object.plot
method ofscipy.stats._result_classes.FitResult
now acceptsa
plot_type
parameter; the options are'hist'
(histogram, default),'qq'
(Q-Q plot),'pp'
(P-P plot), and'cdf'
(empirical CDFplot).
scipy.stats.kstest
) now return thelocation (argmax) at which the statistic is calculated and the variant
of the statistic used.
Improved the performance of several
scipy.stats
functions.scipy.stats.cramervonmises_2samp
andscipy.stats.ks_2samp
withmethod='exact'
.scipy.stats.siegelslopes
.scipy.stats.mstats.hdquantile_sd
.scipy.stats.binned_statistic_dd
for severalNumPy statistics, and binned statistics methods now support complex data.
Added the
scramble
optional argument toscipy.stats.qmc.LatinHypercube
.It replaces
centered
, which is now deprecated.Added a parameter
optimization
to allscipy.stats.qmc.QMCEngine
subclasses to improve characteristics of the quasi-random variates.
Added tie correction to
scipy.stats.mood
.Added tutorials for resampling methods in
scipy.stats
.scipy.stats.bootstrap
,scipy.stats.permutation_test
, andscipy.stats.monte_carlo_test
now automatically detect whether the providedstatistic
is vectorized, so passing thevectorized
argumentexplicitly is no longer required to take advantage of vectorized statistics.
Improved the speed of
scipy.stats.permutation_test
for permutation types'samples'
and'pairings'
.Added
axis
,nan_policy
, and masked array support toscipy.stats.jarque_bera
.Added the
nan_policy
optional argument toscipy.stats.rankdata
.Deprecated features
scipy.misc
module and all the methods inmisc
are deprecated in v1.10and will be completely removed in SciPy v2.0.0. Users are suggested to
utilize the
scipy.datasets
module instead for the dataset methods.scipy.stats.qmc.LatinHypercube
parametercentered
has been deprecated.It is replaced by the
scramble
argument for more consistency with otherQMC engines.
scipy.interpolate.interp2d
class has been deprecated. The docstring of thedeprecated routine lists recommended replacements.
Expired Deprecations
There is an ongoing effort to follow through on long-standing deprecations.
The following previously deprecated features are affected:
cond
&rcond
kwargs inlinalg.pinv
scipy.linalg.blas.{clapack, flapack}
scipy.stats.NumericalInverseHermite
and removedtol
&max_intervals
kwargs fromscipy.stats.sampling.NumericalInverseHermite
local_search_options
kwarg frromscipy.optimize.dual_annealing
.Other changes
scipy.stats.bootstrap
,scipy.stats.permutation_test
, andscipy.stats.monte_carlo_test
now automatically detect whether the providedstatistic
is vectorized by looking for anaxis
parameter in thesignature of
statistic
. If anaxis
parameter is present instatistic
but should not be relied on for vectorized calls, users mustpass option
vectorized==False
explicitly.scipy.stats.multivariate_normal
will now raise aValueError
when thecovariance matrix is not positive semidefinite, regardless of which method
is called.
Authors
A total of 184 people contributed to this release.
People with a "+" by their names contributed a patch for the first time.
This list of names is automatically generated, and may not be fully complete.
v1.9.3
: SciPy 1.9.3Compare Source
SciPy 1.9.3 Release Notes
SciPy
1.9.3
is a bug-fix release with no new featurescompared to
1.9.2
.Authors
A total of 31 people contributed to this release.
People with a "+" by their names contributed a patch for the first time.
This list of names is automatically generated, and may not be fully complete.
v1.9.2
: SciPy 1.9.2Compare Source
SciPy 1.9.2 Release Notes
SciPy
1.9.2
is a bug-fix release with no new featurescompared to
1.9.1
. It also provides wheels for Python3.11
on several platforms.
Authors
A total of 14 people contributed to this release.
People with a "+" by their names contributed a patch for the first time.
This list of names is automatically generated, and may not be fully complete.
v1.9.1
: SciPy 1.9.1Compare Source
SciPy 1.9.1 Release Notes
SciPy
1.9.1
is a bug-fix release with no new featurescompared to
1.9.0
. Notably, some important meson buildfixes are included.
Authors
A total of 8 people contributed to this release.
People with a "+" by their names contributed a patch for the first time.
This list of names is automatically generated, and may not be fully complete.
v1.9.0
: SciPy 1.9.0Compare Source
SciPy 1.9.0 Release Notes
SciPy
1.9.0
is the culmination of 6 months of hard work. It containsmany new features, numerous bug-fixes, improved test coverage and better
documentation. There have been a number of deprecations and API changes
in this release, which are documented below. All users are encouraged to
upgrade to this release, as there are a large number of bug-fixes and
optimizations. Before upgrading, we recommend that users check that
their own code does not use deprecated SciPy functionality (to do so,
run your code with
python -Wd
and check forDeprecationWarning
s).Our development attention will now shift to bug-fix releases on the
1.9.x branch, and on adding new features on the main branch.
This release requires Python
3.8-3.11
and NumPy1.18.5
or greater.For running on PyPy, PyPy3
6.0+
is required.Highlights of this release
meson
, substantially improvingour build performance, and providing better build-time configuration and
cross-compilation support,
scipy.optimize.milp
, new function for mixed-integer linearprogramming,
scipy.stats.fit
for fitting discrete and continuous distributionsto data,
scipy.interpolate.RegularGridInterpolator
,scipy.optimize.direct
.New features
scipy.interpolate
improvementsRBFInterpolator
evaluation with high dimensionalinterpolants.
scipy.interpolate.RegularGridInterpolator
and its tutorial.scipy.interpolate.RegularGridInterpolator
andscipy.interpolate.interpn
now accept descending ordered points.
RegularGridInterpolator
now handles length-1 grid axes.BivariateSpline
subclasses have a new methodpartial_derivative
which constructs a new spline object representing a derivative of an
original spline. This mirrors the corresponding functionality for univariate
splines,
splder
andBSpline.derivative
, and can substantially speedup repeated evaluation of derivatives.
scipy.linalg
improvementsscipy.linalg.expm
now accepts nD arrays. Its speed is also improved.3.7.1
.scipy.fft
improvementsuarray
multimethods forscipy.fft.fht
andscipy.fft.ifht
to allow provision of third party backend implementations such as those
recently added to CuPy.
scipy.optimize
improvementsA new global optimizer,
scipy.optimize.direct
(DIviding RECTangles algorithm)was added. For problems with inexpensive function evaluations, like the ones
in the SciPy benchmark suite,
direct
is competitive with the best othersolvers in SciPy (
dual_annealing
anddifferential_evolution
) in termsof execution time. See
gh-14300 <https://github.com/scipy/scipy/pull/14300>
__ for more details.Add a
full_output
parameter toscipy.optimize.curve_fit
to outputadditional solution information.
Add a
integrality
parameter toscipy.optimize.differential_evolution
,enabling integer constraints on parameters.
Add a
vectorized
parameter to call a vectorized objective function onlyonce per iteration. This can improve minimization speed by reducing
interpreter overhead from the multiple objective function calls.
The default method of
scipy.optimize.linprog
is now'highs'
.Added
scipy.optimize.milp
, new function for mixed-integer linearprogramming.
Added Newton-TFQMR method to
newton_krylov
.Added support for the
Bounds
class inshgo
anddual_annealing
fora more uniform API across
scipy.optimize
.Added the
vectorized
keyword todifferential_evolution
.approx_fprime
now works with vector-valued functions.scipy.signal
improvementsscipy.signal.windows.kaiser_bessel_derived
wasadded to compute the Kaiser-Bessel derived window.
hilbert
operations are now faster as a result of moreconsistent
dtype
handling.scipy.sparse
improvementscopy
parameter toscipy.sparce.csgraph.laplacian
. Using inplacecomputation with
copy=False
reduces the memory footprint.dtype
parameter toscipy.sparce.csgraph.laplacian
for type casting.symmetrized
parameter toscipy.sparce.csgraph.laplacian
to producesymmetric Laplacian for directed graphs.
form
parameter toscipy.sparce.csgraph.laplacian
taking one of thethree values:
array
, orfunction
, orlo
determining the format ofthe output Laplacian:
array
is a numpy array (backward compatible default);function
is a pointer to a lambda-function evaluating theLaplacian-vector or Laplacian-matrix product;
lo
results in the format of theLinearOperator
.scipy.sparse.linalg
improvementslobpcg
performance improvements for small input cases.scipy.spatial
improvementsorder
parameter toscipy.spatial.transform.Rotation.from_quat
and
scipy.spatial.transform.Rotation.as_quat
to specify quaternion format.scipy.stats
improvementsscipy.stats.monte_carlo_test
performs one-sample Monte Carlo hypothesistests to assess whether a sample was drawn from a given distribution. Besides
reproducing the results of hypothesis tests like
scipy.stats.ks_1samp
,scipy.stats.normaltest
, andscipy.stats.cramervonmises
without small samplesize limitations, it makes it possible to perform similar tests using arbitrary
statistics and distributions.
Several
scipy.stats
functions support newaxis
(integer or tuple ofintegers) and
nan_policy
('raise', 'omit', or 'propagate'), andkeepdims
arguments.These functions also support masked arrays as inputs, even if they do not have
a
scipy.stats.mstats
counterpart. Edge cases for multidimensional arrays,such as when axis-slices have no unmasked elements or entire inputs are of
size zero, are handled consistently.
Add a
weight
parameter toscipy.stats.hmean
.Several improvements have been made to
scipy.stats.levy_stable
. Substantialimprovement has been made for numerical evaluation of the pdf and cdf,
resolving #12658 and
#14944. The improvement is
particularly dramatic for stability parameter
alpha
close to or equal to 1and for
alpha
below but approaching its maximum value of 2. The alternativefast Fourier transform based method for pdf calculation has also been updated
to use the approach of Wang and Zhang from their 2008 conference paper
Simpson’s rule based FFT method to compute densities of stable distribution,
making this method more competitive with the default method. In addition,
users now have the option to change the parametrization of the Levy Stable
distribution to Nolan's "S0" parametrization which is used internally by
SciPy's pdf and cdf implementations. The "S0" parametrization is described in
Nolan's paper Numerical calculation of stable densities and distribution
functions upon which SciPy's
implementation is based. "S0" has the advantage that
delta
andgamma
are proper location and scale parameters. With
delta
andgamma
fixed,the location and scale of the resulting distribution remain unchanged as
alpha
andbeta
change. This is not the case for the default "S1"parametrization. Finally, more options have been exposed to allow users to
trade off between runtime and accuracy for both the default and FFT methods of
pdf and cdf calculation. More information can be found in the documentation
here (to be linked).
Added
scipy.stats.fit
for fitting discrete and continuous distributions todata.
The methods
"pearson"
and"tippet"
fromscipy.stats.combine_pvalues
have been fixed to return the correct p-values, resolving
#15373. In addition, the
documentation for
scipy.stats.combine_pvalues
has been expanded and improved.Unlike other reduction functions,
stats.mode
didn't consume the axisbeing operated on and failed for negative axis inputs. Both the bugs have been
fixed. Note that
stats.mode
will now consume the input axis and return anndarray with the
axis
dimension removed.Replaced implementation of
scipy.stats.ncf
with the implementation fromBoost for improved reliability.
Add a
bits
parameter toscipy.stats.qmc.Sobol
. It allows to use from 0to 64 bits to compute the sequence. Default is
None
which corresponds to30 for backward compatibility. Using a higher value allow to sample more
points. Note:
bits
does not affect the output dtype.Add a
integers
method toscipy.stats.qmc.QMCEngine
. It allows samplingintegers using any QMC sampler.
Improved the fit speed and accuracy of
stats.pareto
.Added
qrvs
method toNumericalInversePolynomial
to match thesituation for
NumericalInverseHermite
.Faster random variate generation for
gennorm
andnakagami
.lloyd_centroidal_voronoi_tessellation
has been added to allow improvedsample distributions via iterative application of Voronoi diagrams and
centering operations
Add
scipy.stats.qmc.PoissonDisk
to sample using the Poisson disk samplingmethod. It guarantees that samples are separated from each other by a
given
radius
.Add
scipy.stats.pmean
to calculate the weighted power mean also calledgeneralized mean.
Deprecated features
n
of several distributions,use of the distribution
moment
method with keyword argumentn
isdeprecated. Keyword
n
is replaced with keywordorder
.interval
method with keyword argumentsalpha
is deprecated. Keywordalpha
is replaced with keywordconfidence
.'simplex'
,'revised simplex'
, and'interior-point'
methodsof
scipy.optimize.linprog
are deprecated. Methodshighs
,highs-ds
,or
highs-ipm
should be used in new code.stats.mode
.pandas.DataFrame.mode
can be used instead.spatial.distance.kulsinski
has been deprecated in favorof
spatial.distance.kulczynski1
.maxiter
keyword of the truncated Newton (TNC) algorithm has beendeprecated in favour of
maxfun
.vertices
keyword ofDelauney.qhull
now raises aDeprecationWarning, after having been deprecated in documentation only
for a long time.
extradoc
keyword ofrv_continuous
,rv_discrete
andrv_sample
now raises a DeprecationWarning, after having been deprecated indocumentation only for a long time.
Expired Deprecations
There is an ongoing effort to follow through on long-standing deprecations.
The following previously deprecated features are affected:
radius=None
toscipy.spatial.SphericalVoronoi
now raises anerror (not adding
radius
defaults to 1, as before).ndim > 1
._rvs
method of statistical distributions now requires asize
parameter.
fillvalue
that cannot be cast to the output type inscipy.signal.convolve2d
now raises an error.scipy.spatial.distance
now enforces that the input vectors areone-dimensional.
stats.itemfreq
.stats.median_absolute_deviation
.n_jobs
keyword argument and use ofk=None
fromkdtree.query
.right
keyword frominterpolate.PPoly.extend
.debug
keyword fromscipy.linalg.solve_*
._ppform
scipy.interpolate
.matvec
andmatmat
.mlab
truncation mode fromcluster.dendrogram
.cluster.vq.py_vq2
.ftol
andxtol
fromoptimize.minimize(method='Nelder-Mead')
.signal.windows.hanning
.gegv
functions fromlinalg
; this raises the minimallyrequired LAPACK version to 3.7.1.
spatial.distance.matching
.scipy.random
fornumpy.random
.scipy.misc
(docformat
,inherit_docstring_from
,extend_notes_in_docstring
,replace_notes_in_docstring
,indentcount_lines
,filldoc
,unindent_dict
,unindent_string
).linalg.pinv2
.Backwards incompatible changes
scipy.stats
functions now convertnp.matrix
tonp.ndarray
sbefore the calculation is performed. In this case, the output will be a scalar
or
np.ndarray
of appropriate shape rather than a 2Dnp.matrix
.Similarly, while masked elements of masked arrays are still ignored, the
output will be a scalar or
np.ndarray
rather than a masked array withmask=False
.scipy.optimize.linprog
is now'highs'
, not'interior-point'
(which is now deprecated), so callback functions andsome options are no longer supported with the default method. With the
default method, the
x
attribute of the returnedOptimizeResult
isnow
None
(instead of a non-optimal array) when an optimal solutioncannot be found (e.g. infeasible problem).
scipy.stats.combine_pvalues
, the sign of the test statistic returnedfor the method
"pearson"
has been flipped so that higher values of thestatistic now correspond to lower p-values, making the statistic more
consistent with those of the other methods and with the majority of the
literature.
scipy.linalg.expm
due to historical reasons was using the sparseimplementation and thus was accepting sparse arrays. Now it only works with
nDarrays. For sparse usage,
scipy.sparse.linalg.expm
needs to be usedexplicitly.
scipy.stats.circvar
has reverted to the one that isstandard in the literature; note that this is not the same as the square of
scipy.stats.circstd
.QMCEngine
inMultinomialQMC
andMultivariateNormalQMC
. It removes the methodsfast_forward
andreset
.MultinomialQMC
now require the number of trials withn_trials
.Hence,
MultinomialQMC.random
output has now the correct shape(n, pvals)
.F_onewayConstantInputWarning
,F_onewayBadInputSizesWarning
,PearsonRConstantInputWarning
,PearsonRNearConstantInputWarning
,SpearmanRConstantInputWarning
, andBootstrapDegenerateDistributionWarning
) have been replaced with moregeneral warnings.
Other changes
A draft developer CLI is available for SciPy, leveraging the
doit
,click
andrich-click
tools. For more details, seegh-15959.
The SciPy contributor guide has been reorganized and updated
(see #15947 for details).
QUADPACK Fortran routines in
scipy.integrate
, which powerscipy.integrate.quad
, have been marked asrecursive
. This should fix rareissues in multivariate integration (
nquad
and friends) and obviate the needfor compiler-specific compile flags (
/recursive
for ifort etc). Please filean issue if this change turns out problematic for you. This is also true for
FITPACK
routines inscipy.interpolate
, which powersplrep
,splev
etc., and*UnivariateSpline
and*BivariateSpline
classes.the
USE_PROPACK
environment variable has been renamed toSCIPY_USE_PROPACK
; setting to a non-zero value will enablethe usage of the
PROPACK
library as beforeBuilding SciPy on windows with MSVC now requires at least the vc142
toolset (available in Visual Studio 2019 and higher).
Lazy access to subpackages
Before this release, all subpackages of SciPy (
cluster
,fft
,ndimage
,etc.) had to be explicitly imported. Now, these subpackages are lazily loaded
as soon as they are accessed, so that the following is possible (if desired
for interactive use, it's not actually recommended for code,
see :ref:
scipy-api
):import scipy as sp; sp.fft.dct([1, 2, 3])
. Advantages include: making iteasier to navigate SciPy in interactive terminals, reducing subpackage import
conflicts (which before required
import networkx.linalg as nla; import scipy.linalg as sla
),and avoiding repeatedly having to update imports during teaching &
experimentation. Also see
the related community specification document.
SciPy switched to Meson as its build system
This is the first release that ships with Meson as
the build system. When installing with
pip
orpypa/build
, Meson will beused (invoked via the
meson-python
build hook). This change bringssignificant benefits - most importantly much faster build times, but also
better support for cross-compilation and cleaner build logs.
Note:
This release still ships with support for
numpy.distutils
-based buildsas well. Those can be invoked through the
setup.py
command-lineinterface (e.g.,
python setup.py install
). It is planned to removenumpy.distutils
support before the 1.10.0 release.When building from source, a number of things have changed compared to building
with
numpy.distutils
:meson
,ninja
, andpkg-config
.setuptools
andwheel
are no longer needed.discovery mechanism has: that is now using
pkg-config
instead of hardcodedpaths or a
site.cfg
file.blas-lapack-selection
fordetails.
The two CLIs that can be used to build wheels are
pip
andbuild
. Inaddition, the SciPy repo contains a
python dev.py
CLI for any kind ofdevelopment task (see its
--help
for details). For a comparison between old(
distutils
) and new (meson
) build commands, see :ref:meson-faq
.For more information on the introduction of Meson support in SciPy, see
gh-13615 <https://github.com/scipy/scipy/issues/13615>
__ andthis blog post <https://labs.quansight.org/blog/2021/07/moving-scipy-to-meson/>
__.Authors
A total of 154 people contributed to this release.
People with a "+" by their names contributed a patch for the first time.
This list of names is automatically generated, and may not be fully complete.
v1.8.1
: SciPy 1.8.1Compare Source
SciPy 1.8.1 Release Notes
SciPy
1.8.1
is a bug-fix release with no new featurescompared to
1.8.0
. Notably, usage of Pythran has beenrestored for Windows builds/binaries.
Authors
A total of 17 people contributed to this release.
People with a "+" by their names contributed a patch for the first time.
This list of names is automatically generated, and may not be fully complete.
v1.8.0
: SciPy 1.8.0Compare Source
SciPy 1.8.0 Release Notes
SciPy
1.8.0
is the culmination of6
months of hard work. It containsmany new features, numerous bug-fixes, improved test coverage and better
documentation. There have been a number of deprecations and API changes
in this release, which are documented below. All users are encouraged to
upgrade to this release, as there are a large number of bug-fixes and
optimizations. Before upgrading, we recommend that users check that
their own code does not use deprecated SciPy functionality (to do so,
run your code with
python -Wd
and check forDeprecationWarning
s).Our development attention will now shift to bug-fix releases on the
1.8.x branch, and on adding new features on the master branch.
This release requires Python
3.8+
andNumPy 1.17.3
or greater.For running on PyPy, PyPy3
6.0+
is required.Highlights of this release
work is ongoing, and users should expect minor API refinements over
the next few releases.
is exposed via
scipy.sparse.svds
withsolver='PROPACK'
. It is currentlydefault-off due to potential issues on Windows that we aim to
resolve in the next release, but can be optionally enabled at runtime for
friendly testing with an environment variable setting of
USE_PROPACK=1
.scipy.stats.sampling
submodule that leverages theUNU.RAN
Clibrary to sample from arbitrary univariate non-uniform continuous and
discrete distributions
their names have been deprecated.
New features
scipy.fft
improvementsAdded an
orthogonalize=None
parameter to the real transforms inscipy.fft
which controls whether the modified definition of DCT/DST is used without
changing the overall scaling.
scipy.fft
backend registration is now smoother, operating with a singleregistration call and no longer requiring a context manager.
scipy.integrate
improvementsscipy.integrate.quad_vec
introduces a new optional keyword-only argument,args
.args
takes in a tuple of extra arguments if any (default isargs=()
), which is then internally used to pass into the callable function(needing these extra arguments) which we wish to integrate.
scipy.interpolate
improvementsscipy.interpolate.BSpline
has a new method,design_matrix
, whichconstructs a design matrix of b-splines in the sparse CSR format.
A new method
from_cubic
inBSpline
class allows to convert aCubicSpline
object toBSpline
object.scipy.linalg
improvementsscipy.linalg
gained three new public array structure investigation functions.scipy.linalg.bandwidth
returns information about the bandedness of an arrayand can be used to test for triangular structure discovery, while
scipy.linalg.issymmetric
andscipy.linalg.ishermitian
test the array forexact and approximate symmetric/Hermitian structure.
scipy.optimize
improvementsscipy.optimize.check_grad
introduces two new optional keyword only arguments,direction
andseed
.direction
can take values,'all'
(default),in which case all the one hot direction vectors will be used for verifying
the input analytical gradient function and
'random'
, in which case arandom direction vector will be used for the same purpose.
seed
(default is
None
) can be used for reproducing the return value ofcheck_grad
function. It will be used only whendirection='random'
.The
scipy.optimize.minimize
TNC
method has been rewritten to use Cythonbindings. This also fixes an issue with the callback altering the state of the
optimization.
Added optional parameters
target_accept_rate
andstepwise_factor
foradapative step size adjustment in
basinhopping
.The
epsilon
argument toapprox_fprime
is now optional so that it mayhave a default value consistent with most other functions in
scipy.optimize
.scipy.signal
improvementsAdd
analog
argument, defaultFalse
, tozpk2sos
, and add new pairingoption
'minimal'
to construct analog and minimal discrete SOS arrays.tf2sos
uses zpk2sos; addanalog
argument here as well, and pass it onto
zpk2sos
.savgol_coeffs
andsavgol_filter
now work for even window lengths.Added the Chirp Z-transform and Zoom FFT available as
scipy.signal.CZT
andscipy.signal.ZoomFFT
.scipy.sparse
improvementsAn array API has been added for early testing and feedback; this
work is ongoing, and users should expect minor API refinements over
the next few releases. Please refer to the
scipy.sparse
docstring for more information.
maximum_flow
introduces optional keyword only argument,method
which accepts either,
'edmonds-karp'
(Edmonds Karp algorithm) or'dinic'
(Dinic's algorithm). Moreover,'dinic'
is used as defaultvalue for
method
which means that Dinic's algorithm is used for computingmaximum flow unless specified. See, the comparison between the supported
algorithms in
this comment <https://github.com/scipy/scipy/pull/14358#issue-684212523>
_.Parameters
atol
,btol
now default to 1e-6 inscipy.sparse.linalg.lsmr
to match with default values inscipy.sparse.linalg.lsqr
.Add the Transpose-Free Quasi-Minimal Residual algorithm (TFQMR) for general
nonsingular non-Hermitian linear systems in
scipy.sparse.linalg.tfqmr
.The sparse SVD library PROPACK is now vendored with SciPy, and an interface is
exposed via
scipy.sparse.svds
withsolver='PROPACK'
. For some problems,this may be faster and/or more accurate than the default, ARPACK. PROPACK
functionality is currently opt-in--you must specify
USE_PROPACK=1
atruntime to use it due to potential issues on Windows
that we aim to resolve in the next release.
sparse.linalg
iterative solvers now have a nonzero initial guess option,which may be specified as
x0 = 'Mb'
.The
trace
method has been added for sparse matrices.scipy.spatial
improvementsscipy.spatial.transform.Rotation
now supports item assignment and has a newconcatenate
method.Add
scipy.spatial.distance.kulczynski1
in favour ofscipy.spatial.distance.kulsinski
which will be deprecated in the nextrelease.
scipy.spatial.distance.minkowski
now also supports0<p<1
.scipy.special
improvementsThe new function
scipy.special.log_expit
computes the logarithm of thelogistic sigmoid function. The function is formulated to provide accurate
results for large positive and negative inputs, so it avoids the problems
that would occur in the naive implementation
log(expit(x))
.A suite of five new functions for elliptic integrals:
scipy.special.ellipr{c,d,f,g,j}
. These are theCarlson symmetric elliptic integrals <https://dlmf.nist.gov/19.16>
_, whichhave computational advantages over the classical Legendre integrals. Previous
versions included some elliptic integrals from the Cephes library
(
scipy.special.ellip{k,km1,kinc,e,einc}
) but was missing the integral ofthird kind (Legendre's Pi), which can be evaluated using the new Carlson
functions. The new Carlson elliptic integral functions can be evaluated in the
complex plane, whereas the Cephes library's functions are only defined for
real inputs.
Several defects in
scipy.special.hyp2f1
have been corrected. Approximatelycorrect values are now returned for
z
nearexp(+-i*pi/3)
, fixing#​8054 <https://github.com/scipy/scipy/issues/8054>
. Evaluation for suchz
is now calculated through a series derived by
López and Temme (2013) <https://arxiv.org/abs/1306.2046>
that converges inthese regions. In addition, degenerate cases with one or more of
a
,b
,and/or
c
a non-positive integer are now handled in a manner consistent withmpmath's hyp2f1 implementation <https://mpmath.org/doc/current/functions/hypergeometric.html>
,which fixes
#​7340 <https://github.com/scipy/scipy/issues/7340>
. These fixeswere made as part of an effort to rewrite the Fortran 77 implementation of
hyp2f1 in Cython piece by piece. This rewriting is now roughly 50% complete.
scipy.stats
improvementsscipy.stats.qmc.LatinHypercube
introduces two new optional keyword-onlyarguments,
optimization
andstrength
.optimization
is eitherNone
orrandom-cd
. In the latter, random permutations are performed toimprove the centered discrepancy.
strength
is either 1 or 2. 1 correspondsto the classical LHS while 2 has better sub-projection properties. This
construction is referred to as an orthogonal array based LHS of strength 2.
In both cases, the output is still a LHS.
scipy.stats.qmc.Halton
is faster as the underlying Van der Corput sequencewas ported to Cython.
The
alternative
parameter was added to thekendalltau
andsomersd
functions to allow one-sided hypothesis testing. Similarly, the masked
versions of
skewtest
,kurtosistest
,ttest_1samp
,ttest_ind
,and
ttest_rel
now also have analternative
parameter.Add
scipy.stats.gzscore
to calculate the geometrical z score.Random variate generators to sample from arbitrary univariate non-uniform
continuous and discrete distributions have been added to the new
scipy.stats.sampling
submodule. Implementations of a C libraryUNU.RAN <http://statmath.wu.ac.at/software/unuran/>
_ are used forperformance. The generators added are:
The
binned_statistic
set of functions now have improved performance forthe
std
,min
,max
, andmedian
statistic calculations.somersd
and_tau_b
now have faster Pythran-based implementations.Some general efficiency improvements to handling of
nan
values inseveral
stats
functions.Added the Tukey-Kramer test as
scipy.stats.tukey_hsd
.Improved performance of
scipy.stats.argus
rvs
method.Added the parameter
keepdims
toscipy.stats.variation
and prevent theunde